package rov.ui.view;


import rov.ui.WindowManager;
import rov.data.Controller;

import java.awt.*;
import java.io.*;
import javax.swing.*;


// displays controls for adjustable settings
public class SettingsView implements IView
{
    private static final String TITLE = "Settings";

    private Container mWindow;
    private JPanel mRoot;
private Controller mController;


    public String getTitle()
    {
        return TITLE;
    }

    public void create()
    {
        mWindow = WindowManager.getInstance().createWindow(TITLE, true, true, true, true, 200, 200);
        mRoot = new JPanel();
        mWindow.add(mRoot);

        mRoot.add(new JButton("random button"));
        mRoot.add(new JCheckBox("random checkbox 1"));
        mRoot.add(new JCheckBox("random checkbox 2"));
        mRoot.add(new JCheckBox("random checkbox 3"));

/*
mMotor = new MotorController(new SerialPortEventListener() {
        public void serialEvent(SerialPortEvent oEvent) {
System.out.println("got arduino event");
                if (oEvent.getEventType() == SerialPortEvent.DATA_AVAILABLE) {
try {
                    System.out.print(mMotor.input.read());
} catch (IOException e) {
  System.out.println("Error reading motor output: " + e);
}
                }
        }
});
*/

//        mController = new Controller("10.42.0.45");
    }

    public void destroy() {
        WindowManager.getInstance().destroyWindow(mWindow);
    }

    public void pause() {
    }

    public void resume() {
    }
}
